package com.shopAuth.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.shopAuth.bean.Admin;
import com.shopAuth.service.IAdminService;

import shopBean.common.bean.RestResult;
@RestController
@RequestMapping("/admin/")
public class AdminContoller {

	
	@Autowired
	IAdminService adminService;
	@RequestMapping("reg.api")
	public RestResult reg( @RequestBody Admin admin) {
		
		return adminService.create(admin);
	}
	
	@RequestMapping("login.api")
	public RestResult login( String password,String user) {
		
		return adminService.login(password, user);
	}
	
	@RequestMapping("updatePassword.api")
	public RestResult updatePassword( String password,String user) {
		
		return adminService.updatePassword(password, user);
	}
}
